package cn.jiyun.service.impl;

import cn.jiyun.entity.Yddgl;
import cn.jiyun.entity.Yddqx;
import cn.jiyun.mapper.YddqxMapper;
import cn.jiyun.service.YddqxService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class YddqxServiceImpl extends ServiceImpl<YddqxMapper, Yddqx>implements YddqxService {
    @Autowired
    private YddqxMapper yddqxMapper;
    @Override
    public Page findPage(Integer pageNum, Integer pageSize, Yddqx yddqx) {
//        Page page=new Page(pageNum,pageSize);
//        LambdaQueryWrapper<Yddqx> qr = new LambdaQueryWrapper<>();
//        qr.like(yddqx.getName()!=null,Yddqx::getName,yddqx.getName());
//        qr.eq(yddqx.getStatus()!=null,Yddqx::getStatus,yddqx.getStatus());
//        Page selectPage = baseMapper.selectPage(page, qr);
//        return selectPage;

        Page<Yddqx> yddqxPage = new Page<>(pageNum, pageSize);
        List<Yddqx> list = yddqxMapper.findPage(yddqxPage,yddqx);
        return yddqxPage.setRecords(list);
    }

}
